package miaolib

import (
	"fmt"
	"github.com/urfave/cli/v2"
	"miao-client-plugins/lib/log"
	"os"
)

var (
	BuildTime string
	Version   = "1.0.0"
)

func Do() {
	log.InitLog("test.log", "debug")
	app := &cli.App{
		Name:    "miao",
		Version: fmt.Sprintf("%s build:%s", Version, BuildTime),
		Usage:   "miao 中的一些扩展功能、建投专属的没啥复用意义的、不好直接分类的功能都添加到这里",
	}
	ipCommand := IPCheck{}
	app.Commands = append(app.Commands, ipCommand.Command())

	if err := app.Run(os.Args); err != nil {
		fmt.Printf("命令行调用错误：%s ，请查看帮助文档", err.Error())
	}
}
